import type { EventDTO, EventType } from "@dci/core"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { Breadcrumbs } from "@/components/entity/breadcrumbs"; import { EntityMap } from "@/components/entity/entity-map"; import { JsonLd } from "@/components/entity/json-ld"; import { ExtLink } from "@/components/entity/kv"; import { fPageHref, PagedFacilities, parseFPage } from "@/components/entity/paged-facilities"; import { SectionNav } from "@/components/entity/section-nav"; import { SourcesFooter } from "@/components/entity/sources-footer"; import { EventList } from "@/components/event-list"; import { ClaimsTable, DataQualityPanel } from "@/components/evidence"; import { FacilityTable } from "@/components/facility-table"; import { ExpansionVelocityBlock } from "@/components/intelligence/operator/velocity"; import { CoverageBar, HonestEmpty, MwFigure, PillLink, PipelineBars, PublishedOnlyNote, ShareList } from "@/components/intelligence/shared"; import { WatchButton } from "@/components/intelligence/watch-button"; import { ProjectList } from "@/components/project-list"; import { Badge } from "@/components/ui/badge"; import { Page, Section } from "@/components/ui/card"; import { StackedBar } from "@/components/ui/charts"; import { CountryFlag } from "@/components/ui/country-flag"; import { Metric, MetricCell, MetricRow } from "@/components/ui/metric"; import { EmptyState, ErrorState, OfflineNotice } from "@/components/ui/states"; import { RowLink, TBody, THead, Table, Td, Th, Tr } from "@/components/ui/table"; import { SourceHistory } from "@/components/ui/timeline"; import { api } from "@/lib/api"; import type { DetailFacilitiesMeta } from "@/lib/dto"; import { countryName, fmtDate, fmtInt, fmtMw, fmtPct, pluralize } from "@/lib/format"; import { OPERATOR_KIND_LABEL } from "@/lib/labels"; import { routes } from "@/lib/routes"; import { compactJsonLd, NOT_FOUND_METADATA, pageMetadata } from "@/lib/seo"; import type { SearchParams } from "@/lib/sort"; import { CloudStatusBadge } from "../../cloud-regions/cloud-format"; export const revalidate = 300; type Props = { params: Promise<{ slug: string }>; searchParams: Promise }; function describe(o: { name: string; kind: string | null; facilityCount: number; countryCount: number; knownMw?: number | null; plannedMw?: number | null; hqCountryIso2?: string | null }): string { const parts = [`${o.name} — ${o.kind ? OPERATOR_KIND_LABEL[o.kind as keyof typeof OPERATOR_KIND_LABEL].toLowerCase() : "data center operator"}`]; parts.push(`${fmtInt(o.facilityCount)} ${pluralize(o.facilityCount, "facility", "facilities")} in ${fmtInt(o.countryCount)} ${pluralize(o.countryCount, "country", "countries")}`); if (o.knownMw) parts.push(`${fmtMw(o.knownMw)} known operational capacity`); if (o.plannedMw) parts.push(`≈ ${fmtMw(o.plannedMw)} in the pipeline`); if (o.hqCountryIso2) parts.push(`headquartered in ${countryName(o.hqCountryIso2)}`); return `${parts.join(", ")}. Footprint map, pipeline, expansion velocity, geographic diversity, corporate events, claims and data quality on DataCenterIndex.`; } export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const r = await api.operator(slug); if (!r.ok) return r.status === 404 ? NOT_FOUND_METADATA : { title: "Operator", alternates: { canonical: routes.operator(slug) } }; return pageMetadata({ title: r.data.name, description: describe(r.data), path: routes.operator(slug) }); } /** Corporate events are served separately by the API; everything else on the operator is a physical change. */ const CORPORATE_TYPES = new Set(["acquisition", "investment_announced", "partnership", "executive_change", "customer_agreement", "owner_changed", "operator_changed", "power_agreement"]); export default async function OperatorPage({ params, searchParams }: Props) { const [{ slug }, sp] = await Promise.all([params, searchParams]); const fPage = parseFPage(sp.fPage); const r = await api.operator(slug, fPage > 1 ? { fPage } : undefined); if (!r.ok && r.status === 404) notFound(); if (!r.ok) { return ( ); } const o = r.data; const meta = (r.meta ?? {}) as DetailFacilitiesMeta; const facTotal = meta.facilitiesTotal ?? o.facilityCount; const facPer = meta.facilitiesPerPage ?? 50; const base = routes.operator(slug); const kindLabel = o.kind ? OPERATOR_KIND_LABEL[o.kind] : null; const aliases = o.aliases.filter((a) => a && a !== o.name); const sameAs = Object.values(o.externalIds ?? {}) .map(String) .filter((v) => /^https?:\/\//.test(v)); const statusTotal = Object.values(o.statusBreakdown).reduce((a, b) => a + (b ?? 0), 0); const corporateIds = new Set(o.corporateEvents.map((e) => e.id)); // physical = every non-corporate event (generic types such as news / page_changed stay on this side rather than being dropped) const physical: EventDTO[] = o.recentEvents.filter((e) => !corporateIds.has(e.id) && !CORPORATE_TYPES.has(e.eventType)); const corporate: EventDTO[] = o.corporateEvents.length ? o.corporateEvents : o.recentEvents.filter((e) => CORPORATE_TYPES.has(e.eventType)); const constructionMw = o.constructionMw ?? o.pipeline.construction.mw; const plannedMw = o.plannedMw ?? (o.pipeline.approved.mw === null && o.pipeline.announced.mw === null ? null : (o.pipeline.approved.mw ?? 0) + (o.pipeline.announced.mw ?? 0)); const coverage = o.mwCoverage ?? o.pipeline.mwCoverage; const cloud = [...o.cloudRegions].sort((a, b) => a.code.localeCompare(b.code)); const jsonLd = compactJsonLd({ "@context": "https://schema.org", "@type": "Organization", "@id": `${routes.operator(slug)}#org`, name: o.name, url: o.website ?? undefined, alternateName: aliases.length ? aliases : undefined, sameAs: sameAs.length ? sameAs : undefined, description: o.description ?? describe(o), parentOrganization: o.parent ? { "@type": "Organization", name: o.parent.name } : undefined, location: o.hqCountryIso2 ? { "@type": "Country", name: countryName(o.hqCountryIso2) } : undefined, }); const sections = [ { id: "map", label: "Map", count: o.facilityCount }, { id: "pipeline", label: "Pipeline" }, { id: "geography", label: "Geography", count: o.topCountries.length + o.topMetros.length }, { id: "velocity", label: "Velocity" }, { id: "events", label: "Events", count: physical.length + corporate.length }, { id: "ai", label: "AI facilities", count: o.aiFacilities.length }, { id: "cloud", label: "Cloud regions", count: cloud.length }, { id: "projects", label: "Projects", count: o.projects.length }, { id: "facilities", label: "Facilities", count: facTotal }, { id: "claims", label: "Claims", count: o.claims.length }, { id: "quality", label: "Data quality" }, { id: "history", label: "Source history", count: o.sourceHistory.length }, ]; return (
Operator
{kindLabel && ( {kindLabel} )} {o.isCloudProvider && ( Cloud provider )} {o.isCarrier && ( Carrier )}

{o.name}

{o.hqCountryIso2 && ( HQ )} {o.website && } {o.parent && ( Part of {o.parent.name} )}
Compare with…
{o.description &&

{o.description}

} {aliases.length > 0 && (
Also known as {aliases.slice(0, 6).map((a) => ( {a} ))} {aliases.length > 6 && +{aliases.length - 6}}
)}
} label="Known operational MW" note={o.knownMw ? `published figures · ${fmtPct(coverage)} coverage` : `no published figure · ${fmtPct(coverage)} of facilities publish MW`} /> } label="Under construction" note={constructionMw === null ? `${fmtInt(o.pipeline.construction.count)} ${pluralize(o.pipeline.construction.count, "site")}, MW not published` : `${fmtInt(o.pipeline.construction.count)} ${pluralize(o.pipeline.construction.count, "site")}`} /> } label="Planned MW" note={plannedMw === null ? "not published" : "approved + announced"} /> } label="Capacity coverage" note="share of facilities with a MW figure" />
{statusTotal > 0 && (
Status
)}
Top countries
{o.topCountries.length ? ({ key: c.iso2, label: c.name, href: routes.country(c.slug), count: c.facilityCount, share: c.share, mw: c.knownMw, iso2: c.iso2 }))} /> : } {o.countries.length > o.topCountries.length &&

Top {o.topCountries.length} of {o.countries.length} countries — the facility table covers all of them.

}
Top markets
{o.topMetros.length ? ({ key: m.id, label: m.name, href: routes.market(m.slug), count: m.facilityCount, share: m.share, mw: m.knownMw, iso2: m.countryIso2 }))} /> : } {o.metros.length > o.topMetros.length &&

Top {o.topMetros.length} of {o.metros.length} markets.

}
Live feed →}>

Physical {fmtInt(physical.length)}

Corporate {fmtInt(corporate.length)}

AI index →}> {o.aiFacilities.length ? : }
{cloud.length ? ( {cloud.map((cr) => ( ))}
Code Region Country AZs Status Launched
{cr.code}
{cr.name}
{cr.name} {cr.availabilityZones ?? —} {fmtDate(cr.launchedOn)}
) : ( )}
0 ? All projects → : undefined}>
fPageHref(base, sp, p)} columns={["market", "country", "status", "mw", "type", "confidence"]} />
{o.sourceHistory.length ? : }
); }